<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script type="text/javascript">
	function deleteTicketRelation(id) {
		if(window.confirm("确定删除？"))
			$.ajax({
				//ticket_info_id,Tic_ticket_info_id
				url:"/ticket/deleteTicketTicketRelation.htm?ticket_info_id="+ticketId+"&Tic_ticket_info_id="+id,
				dataType:"json"
			}).done(function(data){
				alert(data.msg);
				if(data.isSuccess)
					$("#relation-index-ticket-table").load("/ticket/ticketRelations.htm?id="+ticketId);
			})
	}
</script>
<table class="table table-striped table-bordered bootstrap-datatable responsive">
	<thead>
	<tr>
	    <th>票品名称</th>
	    <th>所属景区</th>
	    <th>进价</th>
	    <th>市场价</th>
	    <th>库存数量</th>
	    <th>有效时间</th>
	    <th>操作</th>
	</tr>
	</thead>
	<tbody>
		<c:forEach items="${tickets }" var="ticket">
			<tr>
			    <td>${ticket.name }</td>
			    <td class="center">${ticket.scene.name }</td>
			    <td class="center">${ticket.buyin_price }</td>
			    <td class="center">${ticket.list_price }</td>
			    <td class="center">${ticket.inventory }</td>
			    <td class="center">${ticket.from_time_display }-${ticket.end_time_display }</td>
			    <td class="center"><a href="javascript:;" class="btn btn-default" onclick='deleteTicketRelation("${ticket.ticket_info_id}");'>删除</a></td>
			</tr>
		</c:forEach>
	</tbody>
</table>
<a href="javascript:;" class="btn btn-default" onclick="selectMoreTickets();">选择更多</a>